package chapter14;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import chapter5.*;

public class ReflectionTest {
	static
	{
		System.out.println("Loader ReflectionTest!");
	}
	public ReflectionTest(){}
	public ReflectionTest(int i)
	{}

	/**
	 * @param args
	 * @throws ClassNotFoundException 
	 * @throws InvocationTargetException 
	 * @throws IllegalArgumentException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		// TODO Auto-generated method stub
		Class<?> cl=new OverLoad().getClass();
		for(Constructor<?> c:cl.getConstructors())
		{
			System.out.println("ConstructorsName:"+c.getName());
			System.out.println("ConstructorsParams"+Arrays.toString(c.getParameterTypes()));
			if(c.getParameterTypes().length!=0)
				System.out.println(c.newInstance(1).toString());
		}

	}

}
